import java.math.*;

public class Problem12 {

	public static void main(String[] args) {
		int treug = 0;
		int delitel = 0;
		int counter = 0;
		for (int i = 0; i <= 1000000; i++) {
			treug = treug + i;

			for (int j = treug / 2; j >= 1; j--) {

				if (treug % j == 0) {
					counter++;

					if (counter > 499) {
						break;
					}
				}

			}
			if (counter > 499) {
				break;
			}

			counter = 0;

		}
		System.out.println(treug);
	}

}
